// 拒绝邀请（成功）
import { navigation } from "../../../../../utils/commons"

Page({

    data: {
        name: '',
        reason: '',
        id: '',
        msgId: '',
        sessionID: ''
    },

    onLoad(options) {
        this.setData({
            reason: options.reason,
            id: options.id,
            msgId: options.msgId,
            name: options.name,
            sessionID: wx.getStorageSync('sessionID')
        })
    },

    gotoMessage(e) {
        wx.request({
            url: 'https://www.hschuangsai.com/message/reply',
            method: "POST",
            header: {
                "session": this.data.sessionID
            },
            data: {
                "id": this.data.msgId,
                "reason": this.data.reason,
                "status": "REFUSE"
            },
            success: (res) => {
                wx.switchTab({
                    url: '../../../account'
                });
            }
        })
    },

    gotoDetail() {
        navigation('../../invitation/invitation?idOfPrg=' + this.data.id)
    }
})